home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)aac.d64
/
mazin mouse.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
10KB
|
347 lines
10 REM ******************************
20 REM ***** 'MAZIN MOUSE' *****
21 REM *** ***
22 REM -BY-
23 REM HERB UREN
24 REM OTTAWA, ONTARIO
25 REM (AT THE OUTER LIMIT
26 REM OF HIS SKILLS)
27 REM *** ***
28 REM ***** *****
29 REM ******************************
30 IF AA=1 THEN 80
40 PRINT"[147]":POKE 53280,12:POKE 53281,0
50 GOSUB 4000:REM HOLE&CHEESE SPRITES
60 GOSUB 5000 :REM TITLE SCREEN
70 IF AA=0THENAA=1:LOAD"+8POSMOUSE",8,1
80 POKE V+21,3
82 FOR OY=244 TO 230 STEP-1
84 FORT=1TO60:NEXT:POKEV+1,OY:NEXT
85 PRINT"WOULD YOU LIKE INSTRUCTIONS -Y/N";
90 GETKP$:IFKP$="" THEN 90
95 IF KP$="Y" THEN GOSUB5500
100 GOSUB6000
1000 REM ****** MAIN ****** 1001 :
1040 RW=15:CL=32:GOSUB7200:PRINT"[158]<HELP=H>";
1042 RW=6:CL=31:GOSUB 7200:PRINT"DIRECTION":PRINTSPC(33);:INPUT" * [157][157][157][157]";DI$
1045 IF HF=1 THEN HF=0:GOSUB7500
1050 IF DI$="H" THEN 7300
1060 IF DI$="N" THEN POKE S0,202:GOTO1200
1070 IF DI$="S" THEN POKE S0,206:GOTO1200
1080 IF DI$="E" THEN POKE S0,204:GOTO1200
1090 IF DI$="W" THEN POKE S0,208:GOTO1200
1100 IF DI$="NE" THEN POKE S0,203:GOTO1200
1110 IF DI$="SW" THEN POKE S0,207:GOTO1200
1120 IF DI$="SE" THEN POKE S0,205:GOTO1200
1130 IF DI$="NW" THEN POKE S0,209:GOTO1200
1140 GOTO 1040
1180 :
1200 RW=10:CL=31:GOSUB7200
1203 PRINT" HOW FAR ":PRINTSPC(32);:INPUT" 0 [157][157][157][157][157]";LE$
1205 IF HF=1 THEN HF=0:GOSUB7500
1206 IF LE$="H" THEN 7400
1208 L=VAL(LE$)
1210 IF L=0 THEN 1040
1212 IF L>300 THEN 1040
1215 IFL=1 THENL=2
1220 PTR=PEEK(S0)-201
1230 ON PTR GOSUB 2110,2210,2310,2410,2510,2610,2710,2810
1235 IFRS=1THENRS=0:GOTO100 :REM RESTART
1237 IF CH=0 THEN GOSUB 3900:REM 'HOME'
1240 GOTO 1040
2000 REM ***** SET UP MOVE *****
2100 REM *** NORTH ***
2110 GOSUB 2890: REM ASPECT RATIO
2120 NX=OX:NY=OY-L:IX=0:IY=-1:AX=11:AY=2
2125 REM AX,AY - OFFSET FOR MOUSE NOSE
2130 GOSUB2900:GOSUB 3000
2199 RETURN
2200 REM *** NORTHEAST ***
2210 GOSUB 2895
2220 NX=OX+L:NY=OY-L:IX=+1:IY=-1:AX=20:AY=5
2230 GOSUB 2900:GOSUB 3000
2299 RETURN
2300 REM *** EAST ***
2310 L=INT(L/2)*2
2320 NX=OX+L:NY=OY:IX=+1:IY=0:AX=22:AY=13
2330 GOSUB2900:GOSUB 3000
2399 RETURN
2400 REM *** SOUTHEAST ***
2410 GOSUB 2895
2420 NX=OX+L:NY=OY+L:IX=+1:IY=+1:AX=19:AY=19
2430 GOSUB2900:GOSUB 3000
2499 RETURN
2500 REM *** SOUTH ***
2510 GOSUB 2890: REM ASPECT RATIO
2520 NX=OX:NY=OY+L:IX=0:IY=+1:AX=11:AY=21
2530 GOSUB2900:GOSUB 3000
2599 RETURN
2600 REM *** SOUTHWEST ***
2610 GOSUB 2895
2620 NX=OX-L:NY=OY+L:IX=-1:IY=+1:AX=5:AY=18
2630 GOSUB2900:GOSUB 3000
2699 RETURN
2700 REM *** WEST ***
2710 L=INT(L/2)*2
2720 NX=OX-L:NY=OY:IX=-1:IY=0:AX=3:AY=11
2730 GOSUB2900:GOSUB 3000
2799 RETURN
2800 REM *** NORTHWEST ***
2810 GOSUB 2895
2820 NX=OX-L:NY=OY-L:IX=-1:IY=-1:AX=5:AY=4
2830 GOSUB2900:GOSUB 3000
2840 RETURN
2890 REM * CORRECT ASPECT RATIO-FULL *
2892 L=L-(.3*L):RETURN
2895 REM * CORRECT ASPECT RATIO-PART *
2897 L=L-(.2*L):RETURN
2900 REM *** PRE-CHECK RANGE ***
2910 IF NY<50 THEN L=L-(50-NY)
2920 IF NY>228 THEN L=L-(NY-228)
2930 IF NX>238 THEN L=L-(NX-238)
2940 IF NX<22 THEN L=L-(22-NX)
2950 RETURN
3000 REM ***** MOVER *****
3002 DU=PEEK(V+31):DU=PEEK(V+30)
3005 DX=2*IX:DY=2*IY: REM 2-PIXEL STEPS
3010 FOR NN=0 TO INT(L/2): REM COMPENSATE FOR 2-PIXEL STEPS
3015 OX=OX+DX:OY=OY+DY
3020 POKEV,OX:POKEV+1,OY
3030 SR=PEEK(V+30):IF SR AND 1 THEN 3700 :REM SPRITE COLLISION
3040 IF PEEK(V+31)AND1 THEN 3600 :REM TEXT COLLISION
3050 NEXT
3060 IF OX<22 THEN OX=22
3065 IF OX>238 THEN OX=238
3070 IF OY<50 THEN OY=50
3075 IF OY>228 THEN OY=228
3090 RETURN
3600 REM *** TEXT COLLISION ***
3605 IF OX>238 THEN RETURN:REM NOT BORDER
3610 RR=INT((OY-50+AY)/8):CC=INT((OX-24+AX)/8)
3620 RW=RR:CL=CC:GOSUB7200:PRINT" ";
3630 RW=RR+IY:CL=CC+IX:GOSUB7200:PRINT" ";
3635 RW=RR-IY:CL=CC:GOSUB7200:PRINT" ";
3640 RW=RR-IY:CL=CC-IX:GOSUB7200:PRINT" ";
3645 RW=RR:CL=CC-IX:GOSUB7200:PRINT" ";
3650 FORJ=2TO7
3655 IF(PEEK(V+21) AND 2^J)=0 THEN 3665
3660 NEXT J:RETURN :REM ALL CHEESES ON
3665 N=J-1:GOSUB7120: REM NEW CHEESE
3670 POKEV+21,PEEK(V+21)OR 2^J
3680 CH=CH+1:RW=3:CL=34:GOSUB7200:PRINT"[158]";CH
3699 RETURN : REM TO 1235
3700 REM *** SPRITE COLLISION ***
3710 IF SR AND 2 THEN 3770
3715 N=2
3720 IF SR AND(2^N) THEN POKE(V+21),(PEEK(V+21) AND NOT 2^N):GOTO3740
3730 N=N+1:IFN=8 THEN RETURN
3735 GOTO 3720
3740 CH=CH-1:RW=3:CL=34:GOSUB7200:PRINT"[158]";CH
3760 RETURN : REM TO 1235
3770 REM *** START OR END ***
3775 IF CH>0 THEN 3040
3800 RW=17:CL=0:GOSUB7200:FORN=1TO6:PRINTSPC(31);EH$(N);:NEXT
3820 GET AN$:IF AN$="" THEN3820
3830 IF AN$="N" THEN PRINT"[147][154]":POKE 53280,14:POKE 53281,6:POKEV+21,0:END
3840 IF AN$="Y" THENPOKEV,160:POKEV+1,230:LE$="0":DI$="":RS=1:RETURN
3850 GOTO 3820
3900 REM **** FINISH ROUTINE ****
3910 RW=18:CL=0:GOSUB7200:FORN=1TO5:PRINTSPC(31);HH$(N);:NEXT
3920 REM FOR T=1TO2000:NEXT
3930 RETURN
4000 REM **READ HOLE/CHEESE DATA **
4010 M=64:NN=63:FOR PG=200 TO 201
4020 FOR N=0TONN:READ BY:POKE PG*M+N,BY:NEXT:NEXT
4030 RETURN
4040 DATA 0,0,0,0,0,0,1,248,0,15,255,0,31,255,128, 63
4050 DATA 255,192,127,255,224,255,255,240,255,255,240,255,255,240,255, 255
4060 DATA 240,255,255,240,255,255,240,255,255,240,255,255,240,255,255, 240
4070 DATA 255,255,240,255,255,240,255,255,240,255,255,240,255,255,240, 0
4080 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0
4090 DATA 0,0,0,0,0,0,0,0,0,24,0,0,124,0,0, 126
4100 DATA 0,1,252,0,3,63,128,15,31,128,15,124,224,29,248, 240
4120 DATA 60,249,248,44,223,248,7,143,176,0,0,0,0,0,0, 0
5000 REM *** TITLE SCREEN ***
5010 POKE53281,11:PRINT"[147]";:CB=55295:V=53248:S0=2040:POKE V+21,0
5020 PRINT" "
5021 PRINT" "
5022 PRINT" "
5023 PRINT" "
5024 PRINT" "
5025 FORT=1TO100:NEXT:PRINT:PRINT
5030 PRINT" "
5031 PRINT" "
5032 PRINT" "
5033 PRINT" "
5034 PRINT" "
5035 FORT=1TO100:NEXT:PRINT:PRINT
5036 PRINT" "
5037 PRINT" "
5038 PRINT" "
5039 PRINT" "
5040 PRINT" "
5045 PRINT"[158]";
5100 REM *** SET UP SPRITES ***
5105 REM *** HOLE ***
5110 POKE 2041,200:POKEV+40,0:POKE V+3,229:POKE V+2,161:POKEV+21,2
5112 FORT=1TO400:NEXT
5115 REM *** MOUSE ***
5120 OX=160:OY=244
5130 POKE 2040,202:POKEV+39,1:POKE V,OX:POKEV+1,OY
5140 REM *** CHEESES ***
5150 FORN=1TO6:GOSUB 7100
5160 NEXT N
5170 REM * MESSAGES *
5180 DH$(1)="[158] NW N NE "
5181 DH$(2)=" : "
5182 DH$(3)=" W--+--E "
5183 DH$(4)=" : "
5185 DH$(5)=" SW S SE "
5186 DL$(1)="[158]NUMBER OF"
5187 DL$(2)=" STEPS "
5188 DL$(3)="UP TO 300"
5189 DL$(4)="0 35 70"
5190 DL$(5)="^...^...^"
5191 DL$(6)=" SCALE "
5192 HH$(1)="[158] NOW.. "
5193 HH$(2)=" BACK "
5194 HH$(3)=" HOME "
5195 HH$(4)="CAREFULLY"
5196 HH$(5)=" !!! "
5197 EH$(1)="[153] GREAT ! "
5198 EH$(2)=" "
5199 EH$(3)=" PLAY "
5200 EH$(4)=" AGAIN ? "
5205 EH$(5)=" Y OR N "
5210 EH$(6)=" "
5225 A1$=" [157][157] [146]"
5230 RETURN
5291 :
5500 REM ** INSTRUCTIONS **
5501 PRINT"[147]"
5510 PRINT" 'MAZIN' MOUSE IS INTENDED TO GIVE
5515 [153]" PRACTICE IN
5520 PRINT" 1. THE POINTS OF THE COMPASS
5525 RW[178]14:CL[178]0:[141]7200
5530 [129]N[178]1[164]5:[153][166]5);DH$(N):[130]
5540 [129]T[178]1[164]3000:[130]
5550 RW[178]7:CL[178]0:[141]7200:
5560 [153][166]18);"AND"
5570 [153]" 2. THE ESTIMATION OF DISTANCE
5575 PRINT" (ON THE SCREEN)
5580 RW[178]14:CL[178]0:[141]7200
5585 [129]N[178]1[164]5:[153][166]25);DL$(N):[130]
5590 [129]T[178]1[164]3000:[130]
5595 [153]" PRESS SPACE BAR TO CONTINUEWAIT"
5600 [161] G$ :[139] G$[178]"" [167] 5600
5620 [153]"LOAD HELP THIS MOUSE (ON THE GAME SCREEN)
5625 FOR N=1TO21:PRINTSPC(15);"[221]":FORT=1TO50:NEXT:NEXT:PRINTSPC(15);"[173]>";
5627 FORT=1TO1000:NEXT
5630 PRINT" GATHER THESE"
5635 PRINT" CHEESES [174]"
5640 FOR N=1TO5 :PRINTSPC(10);"[221]":FORT=1TO 50:NEXT:NEXT:PRINTSPC(9);"<[189]"
5650 CX=50:FORN=1TO4:POKEV+2+2*N,CX:POKE V+3+2*N,80+20*N
5655 POKEV+21,PEEK(V+21)OR 2^N*2 :NEXT
5657 FORT=1TO1000:NEXT
5660 PRINT"WITHOUT BUMPING":PRINT" INTO THESE"
5670 PRINT" THINGS";:FORN=1TO24:PRINT"-";:FORT=1TO40:NEXT:NEXT
5672 PRINT"> ";A1$;"":FORT=1TO 1000:NEXT
5675 RW=4:CL=22:GOSUB7200:PRINT"AT THE PROMPT":PRINTSPC(22)" DIRECTION[146] ? ";
5680 FOR N=1TO5:PRINT " [146][157]";:FORT=1TO200:NEXT:PRINT"*[157]";:FORT=1TO200:NEXT:NEXT
5685 PRINT:PRINTSPC(22)"ENTER ONE OF .."
5690 PRINTSPC(26);"N":POKES0,202:GOSUB5699
5691 PRINTSPC(26);"NE":POKES0,203:GOSUB5699
5692 PRINTSPC(26);"E":POKES0,204:GOSUB5699THOUT BUMPING
5693 PRINTSPC(26);"SE":POKES0,205:GOSUB5699
5694 PRINTSPC(26);"S" :POKES0,206:GOSUB5699
5695 PRINTSPC(26);"SW":POKES0,207:GOSUB 5699
5696 PRINTSPC(26);"W":POKES0,208:GOSUB5699
5697 PRINTSPC(26);"NW":POKES0,209:GOSUB5699
5698 POKES0,202:GOTO 5700
5699 FORT=1TO700:NEXT:RETURN
5700 RW=3:CL=0:GOSUB7200:FORN=1TO15:PRINTSPC(22);" ":NEXT
5710 RW=4:CL=22:GOSUB7200:PRINT"AT THE PROMPT":PRINTSPC(22)" HOW FAR[146] ? ";
5720 FOR N=1TO5:PRINT " [146][157]";:FORT=1TO200:NEXT:PRINT"0[157]";:FORT=1TO200:NEXT:NEXT
5730 PRINT:PRINTSPC(22)"ENTER THE NUMBER"
5740 PRINTSPC(22)" OF MOUSE STEPS ":FORT=1TO1000:NEXT
5750 PRINTSPC(22)" THIS IS ABOUT "
5760 PRINTSPC(22)" 70 STEPS "
5770 PRINTSPC(22)" ^.......^"
5780 FORT=1TO3000:NEXT:PRINTSPC(22)"PRESS SPACE BAR"
5790 PRINTSPC(24)"TO CONTINUE[146]";
5795 GET K$:IF K$="" THEN 5795
5800 RW=3:CL=0:GOSUB7200:FORN=1TO18:PRINTSPC(22);" ":NEXT
5810 RW=4:CL=21:GOSUB7200:PRINT"HELP IS AVALABLE"
5815 PRINTSPC(21)" ON THE GAME"
5820 PRINTSPC(21)" SCREEN"
5830 PRINTSPC(21)"PRESS..."
5832 PRINTSPC(22)"P[146] TO PLAY"
5834 PRINTSPC(22)"T[146] TECHNICAL NOTE"
5836 PRINTSPC(22)"W[146] WARNING ! "
5838 PRINTSPC(22)"R[146] REPEAT INSTRUCT."
5840 GET KP$:IF KP$="" THEN5840
5842 IF KP$="P" THEN RETURN
5844 IF KP$="T" THEN 5850
5846 IF KP$="W" THEN 5900
5847 IF KP$="R" THEN POKEV+21,3:GOTO5500
5848 GOTO 5840
5850 REM ** TECHNICAL **
5852 POKE V+21,3:PRINT"[147][153]"SPC(11)"TECHNICAL NOTES"
5854 PRINTSPC(11)"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]":PRINT
5856 PRINT" 1. THANKS TO CHRIS ZAMARA FOR 'SPRITE
5858 [153]" ROTATE' ('TRANSACTOR'-V5 01).":[153]
5860 [153]" 2. SCREEN ASPECT RATIO IS CORRECTED
5862 PRINT" (ROUGHLY) IN LINES 2890-2897.":PRINT
5864 PRINT" 3. IF YOU THINK THIS CODE IS SPAGHETTI
5866 [153]" .. YOU SHOULD HAVE SEEN THE VERSION
5868 PRINT" THAT USED THE PART OF THE SCREEN
5870 [153]" TO THE RIGHT OF THE 'SEAM'.
5875 GOTO 5955
5900 REM ** DIRE WARNING **
5905 POKE V+21,3
5910 PRINT"[147][158] !! WARNING: BROWNIES AND BEAVERS !!"
5915 PRINT" [192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]":PRINT:PRINT
5920 PRINT" THE LESSONS THIS GAME TEACHES
5925 [153]" MAY SOME DAY SAVE YOUR VERY LIFE !
5930 PRINT" DEEP IN THE WOODS, LOST, CONFUSED,
5935 [153]" YOU WILL RECALL YOUR EXPERIENCE
5940 PRINT" AT THE KEYBOARD, AND BLESS ME.
5945 [153]" (ON THE OTHER HAND, YOU COULD JUST
5950 PRINT" YELL FOR THE LEADER)
5955 [153]" PRESS SPACE BARWAIT"
5960 [161] KP$:[139] KP$[178]"" [167] 5960
5965 [153]"LOAD":[137]5830
6000 [143] *** GENERATE MAZE ***
6005 V[178]53248:S0[178]2040:[151] S0,202:[151]V[170]16,0:CH[178]4
6010 [153]"LOADSYS";[166]32);"CHEESES"
6015 [153][166]34);"ANDANDAND"
6020 [153][166]33);"+SYS";CH;"SGN"
6022 [153][166]34);"USRUSRUSR"
6030 [129]N[178]1[164]22:RW[178][181]([187](1)[172]20)[170]1:CL[178][181]([187](1)[172]27):[141]7200
6040 [153] A1$;
6050 [130] N
6070 [129] N[178]2[164]5:[141]7120:[151]V[170]21,[194](V[170]21)[176]2[174]N:[130]
6080 [129]N[178]0[164]23:CL[178]30:RW[178]N:[141]7200:[153]"PRINT# ":[130]:[153][166]30);" WAIT";
6090 [142]
7000 [143] ***** SUBR *****
7100 [143] ***** CHEESE *****
7110 [151] 2041[170]N,201:[151]V[170]40[170]N,7
7120 SX[178][181]([187](1)[172]220)[170]24
7130 [151]V[170]2[170]2[172]N,SX
7150 SY[178][181]([187](1)[172]150)[170]50:[151]V[170]3[170]2[172]N,SY
7160 [142]
7200 [143] **** PRINT AT ROW,COL ****
7210 [151]781,RW:[151]782,CL:[151]783,0:[158]65520:[142]
7300 [143] *** DIRECTION HELP ***
7310 RW[178]18:CL[178]0:[141]7200
7320 [129]N[178]1[164]5:[153][166]31);DH$(N);:[130]
7330 HF[178]1:[137] 1040
7400 [143] *** DISTANCE HELP ***
7410 RW[178]17:CL[178]0:[141]7200
7420 [129]N[178]1[164]6:[153][166]31);DL$(N);:[130]
7430 HF[178]1:[137] 1200
7500 [143] ** BLANK MSG AREA **
7505 RW[178]17:CL[178]0:[141]7200
7510 [129]N[178]1[164]7:[153][166]31);EH$(6);:[130]
7520 [142]